% TEST_ID: LANG-EXPAND-0127
% CATEGORY: language/string
% 测试 string 的比较

function test_string_strcmp()
s1 = {"Kansas City, KS", 'Kansas City, MO'};
s2 = 'Kansas City, MO';
tf = strncmp(s1,s2, 11);
assert(isequal(tf, [0 1]));

s1 = string('Kansas City, KS');
s2 = string('Kansas City, MO');
tf = strncmp(s1,s2,11);
assert(tf);

s1 = string({'Jacques';
      'Jean';
      'Jeanne';
      'Jean-Luc';
      'Julie'});
s2 = string('Jean');
tf = strncmp(s1,s2,4);
assert(isequal(tf, [0;1;1;1;0]));

s1 = string('asd');
s2 = string('asds');
tf = strncmp(s1, s2, 4);
assert(~tf);